package servlet.startup;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import org.apache.log4j.Logger;

/**
 * Create By IntelliJ IDEA
 *
 * @Author: jsonor
 * @Create-Time: 2017/9/26 10:34
 * @Description: 启动顺序
 */
public class StartupServlet extends HttpServlet {

  private static final Logger logger = Logger.getLogger(StartupServlet.class);

  @Override
  public void init() throws ServletException {
    logger.warn("Start up servlet has initialize");

    logger.warn(getInitParameter("name"));
    logger.warn(getInitParameter("password"));

    ServletContext ctx = getServletContext();
    logger.warn(ctx.getInitParameter("key11"));
    logger.warn(ctx.getInitParameter("key12"));
  }
}
